#! /usr/bin/python
import os
curpath=os.path.dirname(os.path.abspath(__file__))
for root, dirs,files in os.walk(curpath):
    for f in files:
        fullp=os.path.join(root,f)        
        filename,ext=os.path.splitext(fullp)
        basename=os.path.basename(filename)
        if ext=='.ui':
            os.system('pyuic4 %s -o %s'%(
                                         os.path.join(curpath,fullp),
                                         os.path.join(curpath,'ui_%s.py'%basename)
                                         )
            )
        elif ext=='.qrc':
            os.system('pyrcc4 %s -o %s'%(
                                         os.path.join(curpath,fullp),
                                         os.path.join(curpath,'%s_rc.py'%basename)
                                         )
            )
            